<?php
namespace app\admin\controller;
class Shopapply extends Base
{
    //列表
    public function lists(){
        if(is_post()){
            $d = $this->post;
            $map = [];
            if($d['keyword']!='') $map[] = ['and','b.username|a.title|a.name|a.phone|a.cat_title','like',"%{$d['keyword']}%"];
            $w  = where($map);
            $rs = $this->db->query("
                select
                    a.*,b.username
                from
                    shop_apply a
                inner join
                    user b on a.user_id = b.id
                $w[0] order by a.id desc".limit($d['page'],$d['limit']), $w[1],'',true);
            if($rs){
                $rule = [
                    'create_time' => 'com_time_format',
                ];
                $data = com_format($rs[0],$rule);
                suc($data,$rs[1]);
            }else{
                suc([],0);
            }
        }
        $this->fetch();
    }


}
